Skip to content

Link zlib on all Linux targets - #52

Open
Zakkaus wants to merge 1 commit into
rustdesk-org:masterfrom
Zakkaus:link-zlib-all-linux
Open

Zakkaus wants to merge 1 commit into
rustdesk-org:masterfrom
Zakkaus:link-zlib-all-linux

Conversation

@Zakkaus

@Zakkaus Zakkaus commented Oct 15, 2026 •

Copy link
Copy Markdown

link_os() adds z only when target_arch == "x86_64":

https://github.com/rustdesk-org/hwcodec/blob/master/build.rs#L180-L185

The ffmpeg built through vcpkg links zlib on every architecture, which its own pkg-config file states for the arm64 triplet as well:

$ grep ^Libs vcpkg/installed/arm64-linux/lib/pkgconfig/libavformat.pc
Libs: "-L${libdir}" -lavformat -lm -lz -latomic

So on aarch64 the linker pulls in libavformat's id3v2.o and uncompress stays unresolved:

ld: libhwcodec-*.rlib(id3v2.o): undefined reference to symbol 'uncompress'
ld: /usr/lib64/libz.so.1: error adding symbols: DSO missing from command line

Dropping the architecture condition fixes the aarch64 link and changes nothing on x86_64, where -lz was passed already. target_arch has no other use in link_os() afterwards.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed Linux builds for architectures beyond x86_64 by linking the required compression library.

The ffmpeg built through vcpkg links zlib on every architecture, so on
aarch64 the linker pulls in libavformat's id3v2.o and uncompress stays
unresolved. Passing -lz only on x86_64 leaves that link broken.

Signed-off-by: Zakk <zakk@gentoozh.org>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d503c9b6-58c0-4330-96e4-539bbb826e62
📥 Commits

Reviewing files that changed from the base of the PR and between febec27 and 3943482.

📒 Files selected for processing: 1
  • build.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

On Linux, link_os now links the z library for every target architecture. The drm, X11, and stdc++ libraries remain unchanged.

Changes: Linux Linking

Layer / File(s) Summary
Update Linux library list
build.rs
link_os adds z to the Linux dynamic-library list for every target architecture. The other Linux libraries remain unchanged.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: 21pages

Merge Risk: ⚪ Minimal · up to 39434

This change adds -lz to Linux links to address FFmpeg’s reported zlib symbol. No supported-target regression or other actionable merge blocker is established by the available evidence.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: linking zlib on all Linux targets.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant